:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --text-color: #2c3e50;
    --error-color: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/pattern.png');
    opacity: 0.1;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { background-position: 0 0; }
    100% { background-position: 100% 100%; }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.login-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo i {
    font-size: 2.5rem;
    color: white;
}

.login-header h1 {
    color: var(--text-color);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s forwards;
}

.form-group:nth-child(2) {
    animation-delay: 0.1s;
}

.form-group:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.input-icon i:first-child {
    position: absolute;
    left: 1rem;
    color: #95a5a6;
    transition: color 0.3s;
    z-index: 1;
}

.input-icon input {
    width: 100%;
    padding: 1rem 2.8rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

.input-icon input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.input-icon input:focus + i:first-child {
    color: var(--primary-color);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }

    .login-content {
        padding: 1.5rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .logo {
        width: 60px;
        height: 60px;
    }

    .logo i {
        font-size: 2rem;
    }

    .input-icon input {
        padding: 0.875rem 2.5rem 0.875rem 2.5rem;
        font-size: 0.95rem;
    }

    .btn-login {
        padding: 0.875rem;
    }
}

/* 添加提示消息样式 */
.alert-message {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-message i {
    font-size: 1.1rem;
}

.alert-message.error {
    display: block;
    background: #fde8e8;
    color: #e74c3c;
    border: 1px solid #fbd5d5;
}

.alert-message.success {
    display: block;
    background: #e8f8f5;
    color: #2ecc71;
    border: 1px solid #d1f2eb;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 添加表单震动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

/* 修改输入框样式，添加错误状态 */
.input-icon.error input {
    border-color: var(--error-color);
    background: rgba(231, 76, 60, 0.05);
}

.input-icon.error i:first-child {
    color: var(--error-color);
}

/* 添加输入框提示文字 */
.input-hint {
    font-size: 0.85rem;
    color: var(--error-color);
    margin-top: 0.25rem;
    display: none;
}

.input-icon.error + .input-hint {
    display: block;
}

/* 添加加载动画 */
.btn-login.loading {
    background: #bdc3c7;
    pointer-events: none;
}

.btn-login.loading span {
    opacity: 0;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    top: 50%;
    left: 50%;
    margin-top: -12px;
    margin-left: -12px;
}

/* 优化输入框交互 */
.input-icon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.input-icon.focused::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(1);
    transition: transform 0.3s;
}

/* 添加密码可见性切换 */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.3s;
    z-index: 1;
    padding: 0.5rem;
    background: transparent;
    border-radius: 4px;
}

.password-toggle:hover {
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
}

/* 记住密码样式 */
.remember-group {
    margin-bottom: 1rem;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: #666;
    font-size: 0.9rem;
}

.remember-label input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s;
}

.remember-label input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-label input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-label:hover .checkmark {
    border-color: var(--primary-color);
} 